package com.neusoft.neuiotms.dcom.converter.malfunction;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcom.dto.malfunction.MalfunctionApplyFormAnnexDTO;
import com.neusoft.neuiotms.dcom.model.malfunction.MalfunctionApplyFormAnnex;

@Component
public class MalfunctionApplyFormAnnexConverter
        extends AbstractConverter<MalfunctionApplyFormAnnex, MalfunctionApplyFormAnnexDTO> {

    @Override
    public MalfunctionApplyFormAnnex toModel(final MalfunctionApplyFormAnnexDTO dto) {

        final MalfunctionApplyFormAnnex model = new MalfunctionApplyFormAnnex();
        model.setFsId(dto.getFsId());
        model.setName(dto.getName());
        return model;
    }

    @Override
    public MalfunctionApplyFormAnnexDTO toDTO(final MalfunctionApplyFormAnnex model,
            final boolean forListView) {

        final MalfunctionApplyFormAnnexDTO dto = new MalfunctionApplyFormAnnexDTO();
        dto.setId(model.getId());
        dto.setFsId(model.getFsId());
        dto.setName(model.getName());
        return dto;
    }
}
